package com.oig.sys.workflow.vo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;

import lombok.Data;

import java.util.Date;
import java.util.List;

@Schema
@Data
public class AutoRuleVo {

	@Schema(description = "id")
	private Integer id;

	@Schema(description = "规则名")
	private String autoRuleName;

	@Schema(description = "监听对象id,从选择的对象中带过来")
	private Integer listenerObjectId;
	@Schema(description = "监听对象名称,从选择的对象中带过来")
	private String listenerObjectName;
    @Schema(description = "监听业务单据类型,从选择的对象中带过来")
    private String relationType;


	@Schema(description = "监听事件id,从选择的事件中带过来")
	private Integer listenerEventId;
	@Schema(description = "监听事件名称")
	private String listenerEventName;
    @Schema(description = "监听对象对应数据库表名")
    private String listenerTableName;
	@Schema(description = "监听事件,delete,update,insert事件")
	private String listenerEventOperation;
	@Schema(description = "监听业务单据单号属性名")
	private String relationIdColumn;
	@Schema(description = "update事件条件配置,配置变更字段 {\"field\":\"\",\"listenerType\":\"\",\"oldValue\":\"\"\":\"\",\"newValue\":\"\",\"stepValue\":\"\"} listenerType 0-字段值发生任意变化 1-字段值变更为指定值 2-指定特定变更 3-变更大于指定步长 4-从无变有 5-从有变无")
	private String listenerUpdateCfg ;

	@Schema(description = "状态")
	private String status;
	@Schema(description = "是否启用,0-未启用 1-启用")
	private String enable;

	@Schema(description = "创建人id")
	private Integer createUserId;
	@Schema(description = "创建人")
	private String createUserName;
	@Schema(description = "创建时间")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date createTime;
	@Schema(description = "最后更新人id")
	private Integer lastUpdateId;
	@Schema(description = "最后更新人")
	private String lastUpdateName;
	@Schema(description = "最后更新时间")
	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
	private Date lastUpdateTime;


	@Schema(description = "版本号")
	private Integer version;


	@Schema(description = "所属租户id")
	private Integer tenantId;
	@Schema(description = "所属租户名称")
	private String tenantName;

	@Schema(description = "规则对应分支操作")
	private List<AutoOperationVo> autoOperationVoList;
}
